package com.nbsaas.boot.cms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "文章分类", model = "文章分类")
@Entity
@Table(name = "bs_article_category")
@Comment("文章分类表")
public class ArticleCategory extends AbstractEntity {

    @Comment("分类名称")
    @SearchItem(name = "name", key = "name", label = "分类名称")
    @FormField(title = "分类名称", sortNum = "1", grid = true, required = true)
    @Column(length = 100, nullable = false)
    private String name;

    @Comment("分类描述")
    @FormField(title = "分类描述", sortNum = "2", type = InputType.textarea)
    @Column(length = 500)
    private String description;

    @Comment("父分类ID")
    @FormField(title = "父分类", sortNum = "3", grid = true, type = InputType.select)
    private Long parentId;

    @Comment("分类图标")
    @FormField(title = "分类图标", sortNum = "4", type = InputType.image)
    @Column(length = 500)
    private String icon;

    @Comment("分类图片")
    @FormField(title = "分类图片", sortNum = "5", type = InputType.image)
    @Column(length = 500)
    private String image;

    @Comment("排序")
    @FormField(title = "排序", sortNum = "6", grid = true, type = InputType.el_input_number, sort = true)
    private Integer sort;

    @Comment("是否显示")
    @FormField(title = "是否显示", sortNum = "7", grid = true, type = InputType.select)
    private Boolean visible;

    @Comment("SEO标题")
    @FormField(title = "SEO标题", sortNum = "8")
    @Column(length = 200)
    private String seoTitle;

    @Comment("SEO关键词")
    @FormField(title = "SEO关键词", sortNum = "9")
    @Column(length = 500)
    private String seoKeywords;

    @Comment("SEO描述")
    @FormField(title = "SEO描述", sortNum = "10")
    @Column(length = 1000)
    private String seoDescription;

    @Comment("分类别名")
    @FormField(title = "分类别名", sortNum = "11")
    @Column(length = 100, unique = true)
    private String alias;

    @Comment("文章数量")
    @FormField(title = "文章数量", sortNum = "12", grid = true, type = InputType.el_input_number, sort = true)
    private Integer articleCount;
} 